package com.learn.multi_thread.A_BaseThread.A_Base;

public class ThreadPriority {
    /**
     * setPriority(int new Priority)
     * final int getPriority()
     * @param args
     */

    public static void main(String[] args) {
        MyRunnable mr = new MyRunnable();
        Thread t1 = new Thread(mr, "plane");
        Thread t2 = new Thread(mr, "tank");

        System.out.println("before priority of main is " + Thread.currentThread().getPriority());
        System.out.println("before priority of t1 is " + t1.getPriority());
        System.out.println("before priority of t2 is " + t2.getPriority());

        t1.setPriority(1);
        t2.setPriority(10);

        System.out.println("after priority of main is " + Thread.currentThread().getPriority());
        System.out.println("after priority of t1 is " + t1.getPriority());
        System.out.println("after priority of t2 is " + t2.getPriority());

        t1.start();
        t2.start();
    }
}
